package com.goods.controller.business;

import com.goods.common.model.business.Product;
import com.goods.common.response.ResponseBean;
import com.goods.common.vo.system.PageVO;
import com.goods.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/business/product")
public class ProductController {


    @Autowired
    private ProductService productService;
    //物资资料分页列表展示
    @GetMapping("findProductList")
    public ResponseBean findProductList(@RequestParam Map map){
        PageVO pageVO = productService.findProductList(map);
        return ResponseBean.success(pageVO);
    }

    //编辑物资
    @GetMapping("edit/{id}")
    public ResponseBean edit(@PathVariable Long id) {
        Product product = productService.edit(id);

        return ResponseBean.success(product);
    }
}
